package com.woniu.outlet.dao;

import com.woniu.outlet.po.OrderDeliver;
import com.woniu.outlet.po.OrderDeliverExample;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface OrderDeliverMapper {
    long countByExample(OrderDeliverExample example);

    int deleteByExample(OrderDeliverExample example);
    int deleteByPrimaryKey(Long id);

    int insert(OrderDeliver record);
    int insertSelective(OrderDeliver record);

    List<OrderDeliver> selectByExample(OrderDeliverExample example);
    OrderDeliver selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") OrderDeliver record, @Param("example") OrderDeliverExample example);
    int updateByExample(@Param("record") OrderDeliver record, @Param("example") OrderDeliverExample example);
    int updateByPrimaryKeySelective(OrderDeliver record);
    int updateByPrimaryKey(OrderDeliver record);

    //查询送货信息(根据订单编号)
    @Select("select id,order_id orderId,email,order_no orderNo,address,shipping_method shippingMethod,customer_id customerId,delivery_date deliveryDate,arrival_date arrivalDate from ERP_order_deliver where order_no = #{orderNo}")
    OrderDeliver selectOrderDeliverByOrderNo(String orderNo);

    //删除送货信息(根据订单编号)
    @Delete("delete from ERP_order_deliver where order_no = #{orderNo}")
    void deleteOrderDeliverByOrderNo(String orderNo);

    @Select("select * from ERP_order_deliver where order_no = #{orderNo}")
    OrderDeliver selectByOrderNo(String orderNo);
}